package com.example.canteen.controller;
import com.example.canteen.domain.Products;
import com.example.canteen.service.ProductsService;
import com.example.canteen.service.PurchaseOrderDetailsService;
import com.example.canteen.util.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController

@RequestMapping("/purchaseorderdetails")
@Api(tags = "采购订单明细管理(0304 高凯)")
//@Anonymous
public class PurchaseOrderDetailsController {
    @Autowired
    PurchaseOrderDetailsService service;
    @GetMapping("/getPurchaseOrderDetailsListAll")
    @ApiOperation(value = "获取所有采购订单明细列表")
    public AjaxResult getPurchaseOrderDetailsListAll() {
        System.out.println(service.selectAllPurchaseOrderDetails());
        return AjaxResult.success(service.selectAllPurchaseOrderDetails());
    };
    @GetMapping("/getPurchaseOrderDetailsById")
    @ApiOperation(value = "根据id查询采购订单明细信息")
    public AjaxResult getPurchaseOrderDetailsById(int id) {
        System.out.println(service.selectPurchaseOrderDetailsByID(id));
        return AjaxResult.success(service.selectPurchaseOrderDetailsByID(id));
    }
}
